package cc.rengu.redp.bizimpl.upmp.service.impl;

import cc.rengu.redp.bizimpl.enums.BizDataStatusEnum;
import cc.rengu.redp.bizimpl.upmp.domain.ProfitConfInfo;
import cc.rengu.redp.bizimpl.upmp.dao.ProfitConfInfoMapper;
import cc.rengu.redp.bizimpl.upmp.service.IProfitConfInfoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * @author 刘玉亮.LL
 */
@Service
public class ProfitConfInfoServiceImpl extends ServiceImpl<ProfitConfInfoMapper, ProfitConfInfo> implements IProfitConfInfoService {


    @Override
    public List<ProfitConfInfo> findByBizCode(String bizCode){
        LambdaQueryWrapper<ProfitConfInfo> wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(ProfitConfInfo::getBizCode,bizCode);
        return this.list(wrapper);
    }

    @Override
    public void  cancle(ProfitConfInfo info){
        info.setProfitStatus(BizDataStatusEnum.STATUS_CANCELED.getType());
        this.updateById(info);
    }
    @Override
    public void delete(List<String> list) {
        this.baseMapper.deleteBatchIds(list);
    }
}
